﻿<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>店铺管理</title>
	<meta charset="utf-8" />
    <link href="../themes/default/easyui.css" rel="stylesheet" />
    <link href="../themes/icon.css" rel="stylesheet" />
    <script src="../Scripts/jquery-1.7.1.js"></script>
    <script src="../Scripts/jquery.min.js"></script>
    <script src="../Scripts/jquery.easyui.min.js"></script>
    <style type="text/css">
        .Main_Shop 
        {
            width:100%;
            height:100%;
            background:rgb(244,244,244);
        }
    </style>
    <script type="text/javascript">
        $().ready(function () {
            $('#tbShop').datagrid({
                fitColumns: true,//自动放大，适应宽度，防止滚动
                url: '../jquery-easyui-1.4.3/demo/datagrid/datagrid_data1.json',
                method: "get",
                toolbar: "#db",//制定的工具栏
                pagination: true,//如果为true，显示分页工具栏
                rownumbers: true,//如果为true，则显示一个行号列
                singleSelect: true,//如果为true则只允许选择一行
                columns: [[
                    { field: 'productid', title: '店铺编号', width: 100 },
                    { field: 'productname', title: '店铺名称', width: 100 },
                    { field: 'unitcost', title: '店铺类型', width: 100, align: 'center' },
                    { field: 'productid', title: '联系人', width: 100 },
                    { field: 'productname', title: '联系电话', width: 100 },
                    { field: 'unitcost', title: '地址', width: 100, align: 'center' }
                ]]
            });
            //新增店铺
            $("#btnshopAdd").click(function () {
                $("#dd").dialog({ width: 310, height: 240,left:400,top:0 })
                .dialog("setTitle", "新增店铺").dialog("open");
                $("#frm1").attr("src", "AddShop.html");
            });
            //修改
            $("#btnshopUpdate").click(function () {
                var row = $("#tbShop").datagrid("getSelected");
                if (row != null) {
                    $("#dd").dialog({ width: 310, height: 240, left: 400, top: 0 })
                                   .dialog("setTitle", "修改店铺信息").dialog("open");
                    $("#frm1").attr("src", "AddShop.html");
                }
                else {
                    alert('请选择索要编辑的行');
                }
            });
            //删除
            $("#btnshopDelete").click(function () {
                var row = $("#tbShop").datagrid("getSelected");
                if (row != null)
                {
                    if (confirm('你确定要删除选择的信息吗？'))
                    {

                    }
                }
                else
                {
                    alert('请选择要编辑的行');
                }

            });
            //分配管理员
            $("#btnshopMange").click(function () {
                var row = $("#tbShop").datagrid("getSelected");
                if (row != null)
                {
                    $("#dd").dialog({ width: 310, height: 180, left: 400, top: 0 })
                    .dialog("setTitle", "分配管理员")
                    .dialog("open");
                    $("#frm1").attr("src","ShopManager.html")
                }
                else
                {
                    alert('请选择要分配店长的店铺');
                }
            });

        });
    </script>
</head>
<body>
    <div class="Main_Shop">
        <!-- 按钮 -->
        <div>
        <a id="btnshopAdd" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add'">新增</a> 
        <a id="btnshopUpdate" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-edit'">修改</a>
        <a id="btnshopDelete" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-remove'">删除</a>
        <a id="btnshopMange" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-ok'">分配管理员</a>  
          </div>
        <!-- 条件 -->
        <div> <label for="name">店铺名称:</label>
            <input class="easyui-textbox" type="text" name="txtshopName" ></input>
        
            <label for="name">联系人:</label>
            <input class="easyui-textbox" type="text" name="txtlianxi"></input>

            <label for="name">店铺地址:</label>
            <input class="easyui-textbox" type="text" name="txtshopAddr"></input>
            <a id="btn" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'">查询</a> 

         </div>
        <div id="dd" class="easyui-dialog" data-options="closed:true" style="margin-top:0px;overflow:hidden; ">
            <iframe id="frm1" width="100%" height="100%" frameborder="0"></iframe>
        </div>  
        <div>
            <table  id="tbShop">
            
            </table>  
        </div>
    </div>
 
</body>
</html>
